(C) 1994-1996 Stuart Cheshire <cheshire@cs.stanford.edu>
Here's an example of how to write an adev for AppleTalk.
There is one known limitation in this code:
Apple's adevs seem to be able to display two lines in the Network Control Panel, eg. "EtherTalk/Built-In" or "EtherTalk/Alternate". It's not documented how to do that, and it would be useful for drivers that support multiple ports. My 'MetriTalk' wireless driver supports multiple serial ports, and it would be nice to be able to label the icons "MetriTalk/Printer Port" and "MetriTalk/Modem Port".
How to build the adev:
1. The files adev.π, adev.c and adev.h build adev.rsrc, the user interface portion that interacts with the Network Control Panel.
2. The resulting resource file adev.rsrc is then included in the atlk.π project to build the final adev file.
It could be done the other way round — build the atlk module and then include it in the adev project — but I thought it was more likely that the actual networking code would be the focus of the compile-test-debug cycle. The user interface should rarely have to be changed so it makes sense to build that resource first and then leave it alone.
This sample adev does nothing with the packets. To make it into a real adev, you should make the doWrite routine actually send the packet to your network hardware, and when you receive a packet from the network hardware you should call DeliverPacket to hand the packet up to the AppleTalk software.